<?php $this->load->view('home/common/header'); ?>

<script language="javascript" src="<?php echo base_url(); ?>themes/default/javascript/jquery.timers-1.2.js" type="text/javascript"></script>
<script language="javascript" src="<?php echo base_url(); ?>themes/default/javascript/jquery.easing.1.3.js" type="text/javascript"></script>
<script language="javascript" src="<?php echo base_url(); ?>themes/default/javascript/jquery.galleryview-3.0-dev.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css"  href="<?php echo base_url(); ?>themes/default/css/jquery.galleryview-3.0-dev.css" />
<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="<?php echo base_url(); ?>themes/home/javascript/AC_RunActiveContent.js" language="javascript"></script>
	
<div id="ja-content-main" class="ja-content-main clearfix">                            
<div class="item-page"></div>	

<!-- Start View image -->
<?php foreach($houseArray as $itemData){ ?>
<table width="100%">
<tr>
<td  valign="top">
	<h2><p >Tiêu đề: <span id='title' style="font-weight: bold"><?php echo $itemData->title?></span></p></h2>
	<br>
	Diện tích:
	<br>
	Giá bán:<span id='price' style="font-weight: bold;color:red"><?php echo number_format($itemData->price,0);?> </span>&nbsp;&nbsp;
	<span style="color:red" id='priceRead'><script>jQuery(function(){
		jQuery('#priceRead').html('('+DocTienBangChu('<?php echo $itemData->price?>')+')');
	});</script></span>
	<br>
	Số phòng:
	<br>
	Sổ đỏ:
	<br>
	Miễn trung gian:
	
</td>
<td style="margin-right:5px;" width="300px">
	<ul id="myGallery">
	<?php 
		$j=0;
		$price=number_format($itemData->price,0);
		if($itemData->img1!=null&&$itemData->img1!='')
		{
			$j=1;
			echo ('<li><img alt="'.$itemData->title.'" data-description="Giá: '.$price .'" src="'.base_url().'themes/home/uploads/'.$itemData->img1.'" /></li>');
		}
		if($itemData->img2!=null&&$itemData->img2!='')
		{
			$j=1;
			echo '<li><img alt="'.$itemData->title.'" data-description="Giá: '.$price .'" src="'.base_url().'themes/home/uploads/'.$itemData->img2.'" /></li>';
		}
		if($itemData->img3!=null&&$itemData->img3!='')
		{
			$j=1;
			echo '<li><img alt="'.$itemData->title.'" data-description="Giá: '.$price .'" src="'.base_url().'themes/home/uploads/'.$itemData->img3.'" /></li>';
		}
		if($itemData->img4!=null&&$itemData->img4!='')
		{
			$j=1;
			echo '<li><img alt="'.$itemData->title.'" data-description="Giá: '.$pricee .'" src="'.base_url().'themes/home/uploads/'.$itemData->img4.'" /></li>';
		}
		if($itemData->img5!=null&&$itemData->img5!='')
		{
			$j=1;
			echo '<li><img alt="'.$itemData->title.'" data-description="Giá: '.$price .'" src="'.base_url().'themes/home/uploads/'.$itemData->img5.'" /></li>';
		}
		if($itemData->img6!=null&&$itemData->img6!='')
		{
			$j=1;
			echo '<li><img alt="'.$itemData->title.'" data-description="Giá: '.$price .'" src="'.base_url().'themes/home/uploads/'.$itemData->img6.'" /></li>';
		}
		if($itemData->img7!=null&&$itemData->img7!='')
		{
			$j=1;
			echo '<li><img alt="'.$itemData->title.'" data-description="Giá: '.$price .'" src="'.base_url().'themes/home/uploads/'.$itemData->img7.'" /></li>';
		}
		if($itemData->img8!=null&&$itemData->img8!='')
		{
			$j=1;
			echo '<li><img alt="'.$itemData->title.'" data-description="Giá: '.$price.'" src="'.base_url().'themes/home/uploads/'.$itemData->img8.'" /></li>';
		}
		if($itemData->img9!=null&&$itemData->img9!='')
		{
			$j=1;
			echo '<li><img alt="'.$itemData->title.'" data-description="Giá: '.$price .'" src="'.base_url().'themes/home/uploads/'.$itemData->img9.'"/></li>';
		}
		if($itemData->img10!=null&&$itemData->img10!='')
		{
			$j=1;
			echo '<li><img alt="'.$itemData->title.'" data-description="Giá: '.$price .'" src="'.base_url().'themes/home/uploads/'.$itemData->img10.'" /></li>';
		}
		if($itemData->img11!=null&&$itemData->img11!='')
		{
			$j=1;
			echo '<li><img alt="'.$itemData->title.'" data-description="Giá: '.$price .'" src="'.base_url().'themes/home/uploads/'.$itemData->img11.'" /></li>';
		}
		if($itemData->img12!=null&&$itemData->img12!='')
		{
			$j=1;
			echo '<li><img alt="'.$itemData->title.'" data-description="Giá: '.$price .'" src="'.base_url().'themes/home/uploads/'.$itemData->img12.'" /></li>';
		}
		echo $j;
		if($j==0)
		{
			echo '<li><img alt="'.$itemData->title.'" data-description="Giá: '.$price.'" src="'.base_url().'themes/home/images/demohouse.gif" /></li>';
		}
	?>
	</ul>
</td>
</tr>
<tr>
	<td colspan="2">
		<h3 >Chi tiết:</h3>
		<span id='desc'><?php echo $itemData->description?></span>
	</td>	
</tr>
<tr>
	<td colspan="2">
		<h3 >Vị trí chỉ dẫn:</h3>
		<img id='imgMap' src='<?php echo base_url(); ?>themes/default/images/LoadingIcon.gif'/>
	</td>	
</tr>

</table>

<!-- End View image -->

<!--right panel end -->
<br class="spacer" />

<script type="text/javascript">


jQuery(function(){
   //var mapLink='http://maps.googleapis.com/maps/api/staticmap?scale=1&size=400x300&zoom=17&sensor=false&markers='+itemData.lat+','+itemData.lng + '&key=AIzaSyBI9CNhSM8ZWBTT2LfZc3yfx7oxOZ_hFP4';
    var mapLink='http://maps.googleapis.com/maps/api/staticmap?scale=1&size=400x300&zoom=17&sensor=false&markers=<?php echo $itemData->lat?>,<?php echo $itemData->lng?>' ;//+ '&key=LOCAL_KEY'
    jQuery('#imgMap').attr('src',mapLink);	
    jQuery('#myGallery').galleryView();		
});


</script>
<?php } ?>
<?php $this->load->view('home/common/body'); ?>
<?php $this->load->view('home/common/footer'); ?>
